<?php
/**
 * Blog/Show.php
 * --------------------------------------------------
 * Show the blog files from your web/content/blog folder
 */

$page->title = "News";

?>

<section class="news-blog">
  <div class="row">
    <div class="six columns">
      <h1 class="page-title">News</h1>
    </div>
    <div class="six columns l-right">
      <a href="<?= wufoo('nrhc-enews') ?>" target="_blank"><strong>Subscribe</strong> to the NRHC eNews</a>
    </div>
  </div>

<?php

if( !$page->error ) :
  $blogs = $page->blogs;
?>

<ul class="block-grid four-up mobile-two-up">
<?php foreach( $blogs as $entry ): ?>
  <li>
    <article class="entry">
      <?php if( $entry->thumb ) : ?>
      <a href="/<?=$entry->url()?>">
        <img src="<?=$entry->thumb?>" alt="<?= $entry->title ?>">
      </a>
      <?php endif ?>
      <?php echo html( $entry->intro() ) ?>
      <p>
        <a href="/<?= $entry->url() ?>" class="tiny button">Read More &raquo;</a>
      </p>
      <footer>
        <time>published <?= date('M j', strtotime($entry->date)) ?></time>
      </footer>
    </article>
  </li>
<?php endforeach; ?>
</ul>

<footer>
  <?php /*
  <a href="/<?php echo url( '/news/feed' ) ?>" class="rss">Subscribe</a>
  */ ?>
  <?php echo module( 'liriope', 'pagination', array( 'page'=>$page )) ?>
</footer>

<?php else: ?>
  <p>No posts were found</p>
<?php endif ?>

</section><!-- /#blog-list -->

<ul class="breadcrumbs">
  <li><a href="<?= url('/') ?>">Home</a></li>
  <li class="current"><a href="/<?= $page->url ?>"><?= $page->title ?></a></li>
</ul>
